<?php

// APP版本升级检测
Route::get('appVersion', 'VersionController@appVersion');
// 参数配置
Route::get('setting', 'AuthController@setting');
// 矿池列表
Route::get('pool', 'PoolController@pool');
// 点赞
Route::post('poolUp', 'PoolController@poolUp')->middleware('auth:api');
// 节点详情
Route::get('nodeDetail', 'GameController@nodeDetail');
Route::group(['prefix' => 'auth'], function () {
    // 注册
    Route::post('email_register', 'AuthController@emailRegister');
    Route::post('phone_register', 'AuthController@PhoneRegister');
    // 登录
    Route::post('login', 'AuthController@login');

    Route::post('sendsms', 'SmsController@sendCode');

    Route::post('sendemail', 'EmailController@sendCode');

    Route::post('email_find', 'AuthController@email_find');
    Route::post('phone_find', 'AuthController@phone_find');
    Route::group(['middleware' => 'auth:api'], function () {
        // 用户信息
        Route::get('userInfo', 'AuthController@userInfo');

        Route::post('upload', 'UploadController@uploadFile');
        // 退出登录
        Route::get('logout', 'AuthController@logout');

        Route::post('setPayPwd', 'AuthController@setPayPwd');
        Route::post('modiPayPwd', 'AuthController@modiPayPwd');

        Route::post('setPwd', 'AuthController@setPwd');
        // 邀请好友（统计）
        Route::get('statistic', 'AuthController@poolTop');
        // 邀请好友（列表）
        Route::get('registerList', 'AuthController@poolList');
    });
});

Route::group(['prefix' => 'help'], function () {
    // 公告列表
    Route::get('notice', 'HelpController@notice');
    Route::get('detail', 'HelpController@detail');
    Route::post('feedback', 'HelpController@feedback')->middleware('auth:api');
    Route::get('feedbacklist', 'HelpController@feedbacklist')->middleware('auth:api');
    Route::get('feedbackdetail', 'HelpController@feedbackdetail')->middleware('auth:api');
});

Route::group(['prefix' => 'account', 'middleware' => 'auth:api'], function () {
    // 团队列表
    Route::get('teamList', 'GameController@teamList');

    // DSE质押钱包、收益钱包账户
    Route::get('bp', 'AccountController@bp');
    // DSE质押钱包、收益钱包明细
    Route::get('bpList', 'AccountController@bpLog');
    Route::get('profitLog', 'AccountController@profitList');

    // 地址列表
    Route::get('address/{coin?}', 'AddressController@index');
    // 添加地址
    Route::post('address', 'AddressController@store');
    // 删除地址
    Route::delete('address/{address}', 'AddressController@destroy');

    // 充币记录
    Route::get('recharge/{coin?}', 'RechargeController@index');
    // 提现记录
    Route::get('withdraw/{coin?}', 'WithdrawController@index');
    // 申请提现
    Route::post('withdraw', 'WithdrawController@store');


    // DSE质押币划转（交易账户->质押币账户）
    Route::post('transferIn', 'TransferController@transferIn');
    // DSE质押币划转记录（交易账户->质押币账户）
    Route::get('transferIn', 'TransferController@transferInList');
    // DSE质押币转移（A用户->B用户）
    Route::post('transfer', 'TransferController@transfer');
    // DSE质押币转移记录（A用户->B用户）
    Route::get('transfer', 'TransferController@index');
    // 质押（选购节点）
    Route::post('buyNode', 'GameController@buyNode');
    // 质押（预购节点）
    Route::post('preNode', 'GameController@preNode');

    // DSE收益币兑换
    Route::post('exchange', 'ExchangeController@exchange');
    // DSE收益币兑换记录
    Route::get('exchange', 'ExchangeController@index');

    // 推荐奖励
    Route::get('profitList', 'AccountController@profitLog');
});

Route::group(['prefix' => 'good'], function () {
    // 商品列表
    Route::get('index', 'GoodController@index');
    //商品详情
    Route::post('show', 'GoodController@show');
});

Route::group(['prefix' => 'show-address', 'middleware' => 'auth:api'], function () {
    // 地址列表
    Route::get('index', 'ShopAddressController@index');
    //添加地址
    Route::post('store', 'ShopAddressController@store');
    //地址更新
    Route::post('update', 'ShopAddressController@update');
    //地址删除
    Route::post('destroy', 'ShopAddressController@destroy');
});

Route::group(['prefix' => 'order', 'middleware' => 'auth:api'], function () {
    // 订单列表
    Route::get('index', 'OrderController@index');
    //购买商品
    Route::post('pay-good', 'OrderController@payGood');
    //确认收货
    Route::post('confirm-receipt', 'OrderController@confirmReceipt');
    // 订单详情
    Route::post('show', 'OrderController@show');
});
